<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<style>
    .product-list {

    }

    .product-list .product-group {
        width: 100%;
        height: 34px;
        margin-top: 5px;
    }

    .product-list .product-group * {
        float: left;
        display: inline-block;
        height: 34px;
        line-height: 34px;
    }

    .product-list .product-group span {
        width: 60%;
    }


    .product-list .product-group input {
        width: 30%;
    }


    .product-list .product-group i {
        width: 40px;
        cursor: pointer;
        text-align: center;
    }


</style>
<body class="gray-bg">
<div class="wrapper wrapper-content ">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-content">
                    <form class="form-horizontal m-t" id="signupForm">
                        <div class="form-group">
                            <label class="col-sm-3 control-label">
                                经销商：
                                <span style="color: #e7262a">*</span>
                            </label>
                            <div class="col-sm-6">
                                <input id="invoiceId" name="invoiceId" type="hidden" th:value="${invoice.invoiceId}">
                                <input id="agentId" name="agentId" th:value="${invoice.agentId}"  type="hidden">
                                <input id="logisticId" name="logisticId" th:value="${invoice.logisticsId}"  type="hidden">
                                <input id="agentName" th:value="${invoice.agentName}" class="form-control"
                                       type="text" required placeholder="经销商（必填）"
                                       readonly>
                            </div>
                            <a class="btn btn-primary col-sm-2" option="agentSelect">选择经销商</a>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-3 control-label">
                                联系人：
                                <span style="color: #e7262a">*</span>
                            </label>
                            <div class="col-sm-8">
                                <input id="linkman" name="linkman"
                                       th:value="${invoice.linkman}"
                                       class="form-control" type="text" required
                                       placeholder="联系人（必填）">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">
                                电话：
                                <span style="color: #e7262a">*</span>
                            </label>
                            <div class="col-sm-8">
                                <input id="tel" name="tel"
                                       th:value="${invoice.tel}"
                                       class="form-control" type="tel" required
                                       placeholder="联系电话（必填）">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-3 control-label">
                                收货地址：
                                <span style="color: #e7262a">*</span>
                            </label>
                            <div class="col-sm-8">
                                <input id="deliverAddress" name="deliverAddress"
                                       th:value="${invoice.deliverAddress}"
                                       class="form-control" type="text"
                                       required placeholder="收货地址（必填）">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-3 control-label">
                                发货时间：
                                <span style="color: #e7262a">*</span>
                            </label>
                            <div class="col-sm-8">
                                <input id="deliverDate" name="deliverDate"
                                       th:value="${invoice.deliverDate}"
                                       class="form-control" type="date"
                                       required placeholder="发货时间">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-3 control-label">
                                批号：
                                <span style="color: #e7262a">*</span>
                            </label>
                            <div class="col-sm-8">
                                <input id="code" name="code"
                                       th:value="${invoice.code}"
                                       class="form-control" type="text"
                                       required placeholder="批号（必填）">
                            </div>
                        </div>

                        <!--<div class="form-group">-->
                            <!--<label class="col-sm-3 control-label">-->
                                <!--物流公司：-->
                                <!--<span style="color: #e7262a">*</span>-->
                            <!--</label>-->
                            <!--<div class="col-sm-8">-->
                                <!--<input id="logistics" name="logistics" th:value="${invoice.logistics}" class="form-control" type="text"-->
                                       <!--required placeholder="物流公司（必填）">-->
                            <!--</div>-->
                        <!--</div>-->
                        <div class="form-group">
                            <label class="col-sm-3 control-label">物流公司：</label>
                            <div class="col-sm-8">
                                <select class="form-control" id="logisticsId" name="logisticsId">

                                </select>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-3 control-label">备注：</label>
                            <div class="col-sm-8">
                                <input id="remark" name="remark" th:value="${invoice.remark}" class="form-control" type="text" placeholder="备注">
                            </div>
                        </div>

                        <div class="form-group">
                            <div class="col-sm-8 col-sm-offset-3">
                                <button type="submit" class="btn btn-primary">提交</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<div th:include="include::footer"></div>
<script type="text/javascript" th:inline="javascript">
    function initDate(){
        var date  = [[${invoice.deliverDate}]];
        console.log(date)
        if (date != null){
            date = date.substring(0,10)
        }

        $("#deliverDate").val(date);
    }
</script>
<script type="text/javascript" th:src="@{/js/appjs/invoice/edit.js}" src="/static/js/appjs/invoice/add.js">
</script>

</body>
</html>
